import React from 'react';
import { List } from 'antd-mobile';
import { Helmet } from 'react-helmet';
import { version } from '../utils/data';

const Item = List.Item;
const Brief = Item.Brief;

export default class extends React.Component {
  render() {
    return (
      <div>
        <Helmet>
          <title>
            版本与更新
          </title>
        </Helmet>

        <List>
          {
            version.data.map((item, index) => {
              return (
                <Item
                  key={index}
                  arrow="horizontal" multipleLine onClick={() => {
                    if (index === 0) {
                      version.setClick();
                    }
                    location.href = item.href;
                  }}
                >
                  {item.name}
                  <Brief>{item.date}</Brief>
                </Item>
              );
            })
          }
        </List>
      </div>
    );
  }
}
